package ma.ac.onousc.gestionfi.EngagementPaiement.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;

@Entity
@NamedQuery(name = "Convention.findByRB", query = "select cv from Convention cv where cv.rubriqueBudgetaire=:rb")
@DiscriminatorValue("Conv")
public class Convention extends Engagement implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String objetConvention;
	private int dureeConvention;
	private String beneficiaireConvention;

	@ManyToOne(fetch = FetchType.EAGER)
	private Fournisseur fournisseur;



	public Convention(String objetConvention, int dureeConvention,
			String beneficiaireConvention) {
		super();
		this.objetConvention = objetConvention;
		this.dureeConvention = dureeConvention;
		this.beneficiaireConvention = beneficiaireConvention;
	}

	public Convention() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Convention(String numEngagement, Date dateEngagement,
			double montantEngagement, String typeEngagement) {
		super(numEngagement, dateEngagement, montantEngagement, typeEngagement);
		// TODO Auto-generated constructor stub
	}

	public String getObjetConvention() {
		return objetConvention;
	}

	public void setObjetConvention(String objetConvention) {
		this.objetConvention = objetConvention;
	}

	public int getDureeConvention() {
		return dureeConvention;
	}

	public void setDureeConvention(int dureeConvention) {
		this.dureeConvention = dureeConvention;
	}

	public String getBeneficiaireConvention() {
		return beneficiaireConvention;
	}

	public void setBeneficiaireConvention(String beneficiaireConvention) {
		this.beneficiaireConvention = beneficiaireConvention;
	}

	public Fournisseur getFournisseur() {
		return fournisseur;
	}

	public void setFournisseur(Fournisseur fournisseur) {
		this.fournisseur = fournisseur;
	}

}
